<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'assistExpress.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"
	href="${staticPath }/static/bootstrap/bootstrap.min.css" />

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet"
	href="${staticPath }/static/bootstrap/bootstrap-theme.min.css" />
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="${staticPath }/static/easyui/jquery.min.js"></script>
</head>
<body>
	<div style="width:70%;  margin: 0 auto;margin-top:25px">
		<h3 style="text-align:right"><a href="/haierp1/assistPurchase/queryAssistPurchase">协助采购时间</a><h3>
		<h4 style="color:blue">协助快递取件数请及时填写!!!</h4>
		<form action="/haierp1/assistExpress/editAssistExpress" method="post">
			<table class="table table-bordered">
				<tr>
					<td>仓库人员：</td>
					<td>
						<select id="warehousePerson" name="warehousePerson" required>
							<option selected="selected" value="">请选择</option>
							<option name="佳佳" value="佳佳">佳佳</option>
							<option name="steph" value="steph">steph</option>
							<option name="王天雄" value="王天雄">王天雄</option>
							<option name="李磊" value="李磊">李磊</option>
							<option name="华" value="华">华</option>
							<option name="邦" value="邦">邦</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>协助快递取件数量：</td>
					<td><input id="assistPackageNum" name="assistPackageNum" type="number" required="required" placeholder="请输入包裹数量" value="" /></td>
				</tr>
				<tr>
					<td align="right" colspan="2">
						<input type="hidden" id="id" name="id" value="" />
						<input id="subName" type="submit" value="添加" />
					</td>
				</tr>
			</table>
		</form>
		<table class="table table-bordered">
			<tr class="info">
				<td>日期</td>
				<td>仓库人员</td>
				<td>协助快递取件数量</td>
				<td>操作</td>
			</tr>
			<c:set var="tjNum" value="1"/>
			<c:forEach items="${assistExpresstList}" var="assistExpress">
				<tr>
					<c:if test="${tjNum == 1}">
						<td rowspan=${expressMap[assistExpress.dimensionDate].count} style="text-align:center;vertical-align:middle">${assistExpress.dimensionDate}</td>
					</c:if>
					<td>${assistExpress.warehousePerson}</td>
					<td>${assistExpress.assistPackageNum}</td>
					<td><a href="javascript:void(0)" onclick="updateassistExpressTable(${assistExpress.id}, '${assistExpress.warehousePerson}', ${assistExpress.assistPackageNum})">修改</a></td>
				</tr>
				<c:if test="${tjNum == expressMap[assistExpress.dimensionDate].count}">
					<c:set var="tjNum" value="0"/>
				</c:if>
				<c:set var="tjNum" value="${ tjNum+1 }"/>
			</c:forEach>
		</table>
	</div>
	<script type="text/javascript">
		function updateassistExpressTable(id, warehousePerson, assistPackageNum){
			var memberquestion = document.getElementById("warehousePerson");
			for(var i=0; i<memberquestion.options.length; i++) {
				if(warehousePerson == memberquestion.options[i].value){
					memberquestion.options[i].selected = true;
				}
			}
			$('#assistPackageNum').val(assistPackageNum);
			$('#id').val(id);
			$('#subName').val('修改');
		}
	</script>
</body>
</html>
